package com.example.demo.comtroller;

import com.example.demo.service.ModifyService;
import org.joda.time.DateTime;

public class ModifyController {
    ModifyService modifyService;
    private static final String SUCCESS = "400";
    private static final String FAIL = "200";

    public String delete(String stuid) {
        Boolean result = modifyService.delete(stuid);
        if(result) {
            return SUCCESS
        }
        else{
            return FAIL;
        }
    }

    public String add(String stuid,String name,String tel,String classid,String office,int age,Boolean gender,String introduction,String photo,String seat,String hometown,String politicalStatus,Datetime birthday,String ID){
        Boolean result = modifyService.add(stuid,name,tel,classid,office,age,gender,introduction,photo,seat,hometown,politicalStatus,birthday,ID);
        if(result) {
            return SUCCESS
        }
        else{
            return FAIL;
        }
    }

    public String modifyBasic(String stuid,String name,String tel,String classid,String office,int age,Boolean gender,String introduction,String hometown,String politicalStatus,Datetime birthday,String ID){
        Boolean result = modifyService.modifyBasic(stuid,name,tel,classid,office,age,gender,introduction,hometown,politicalStatus,birthday,ID);
        if(result) {
            return SUCCESS
        }
        else{
            return FAIL;
        }
    }

    public String modifyPhoto(String stuid,String photo){
        Boolean result = modifyService.modifyPhoto(stuid,photo);
        if(result) {
            return SUCCESS
        }
        else{
            return FAIL;
        }
    }

    public String modifyPhoto(String stuid,String seat){
        Boolean result = modifyService.modifySeat(stuid,seat);
        if(result) {
            return SUCCESS
        }
        else{
            return FAIL;
        }
    }


}
